package jp.dodododo.aop.interceptors;

import jp.dodododo.aop.annotation.Enhance;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * {@.en }
 * 
 * <br />
 * 
 * {@.ja commons-langのBuilderを使用して、toString(),hashCode(),equals(Object)の値を返します。}
 * 
 * @author Satoshi Kimura
 */
@Enhance(false)
public class CommonsBuilderInterceptor extends TakeOverInterceptor {

	@Override
	public String toString() {
		Object target = getThis();
		return ToStringBuilder.reflectionToString(target);
	}

	@Override
	public int hashCode() {
		Object target = getThis();
		return HashCodeBuilder.reflectionHashCode(target);
	}

	@Override
	public boolean equals(Object obj) {
		Object target = getThis();
		return EqualsBuilder.reflectionEquals(target, obj);
	}

}
